package org.feng.api.animal.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.feng.api.sys.constants.BaseEnum;

/**
 * 性别
 *
 * @author feng
 */
@Getter
@AllArgsConstructor
public enum AnimalSexEnum implements BaseEnum {
    MALE(0, "雄性"),
    FEMALE(1, "雌性"),
    UN_KNOWN(-1, "未知");

    private final int code;
    private final String desc;

    public static AnimalSexEnum getByCode(Integer code) {
        return BaseEnum.convertToEnum(code, AnimalSexEnum.class);
    }

    public static AnimalSexEnum getByDesc(String desc) {
        return BaseEnum.convertToEnum(desc, AnimalSexEnum.class);
    }
}
